import {request} from "@/plugins/axios";

const cars='/car2';

export function list() {
    return new request({
        url: cars,
        method: 'get'
    })
}

export function add(car) {
    return new request({
        url: cars + '/add',
        method: 'post',
        data: car
    })
}

export function del(carId) {
        return new request({
            url: cars +'/'+carId,
            method: 'delete',
        })
}

export function get(carId) {
    return new request({
        url: `${cars}/${carId}`,
        method: 'get',
    })
}

export function update(data) {
    return new request({
        url: cars,
        method:'put',
        data: data
})
}